package service;
import bean.Hero;
import dao.HeroDAO;

import java.sql.SQLException;
import java.util.List;

public class HeroService {

        public void add(Hero hero) throws SQLException {
            HeroDAO dao = new HeroDAO();
            dao.add(hero);
        }


        public void delete(int id) throws SQLException {
            HeroDAO dao = new HeroDAO();
            dao.delete(id);
        }


        public Hero get(int id) throws SQLException {
            HeroDAO dao = new HeroDAO();
            return dao.get(id);
        }


        public void update(Hero hero) throws SQLException {
            HeroDAO dao = new HeroDAO();
            dao.update(hero);

        }


}
